package com.ccl.iot;
public class IOTFormulas {
	public static class IOTIntFormula extends IOTFormula<Integer>{
		IOTIntFormula(String aFormula) {
			super(aFormula);
		}
		
		IOTIntFormula(IOTFormula<?> aFormula){
			super(aFormula);
		}
		
		@Override
		protected Integer resolveValue(String aValue) {
			if (aValue != null){
				try{
					return Integer.valueOf(aValue);
				}catch (Exception e){
				}
			}
			
			return null;
		}
	}
	
	public static class IOTLongFormula extends IOTFormula<Long>{
		IOTLongFormula(String aFormula) {
			super(aFormula);
		}
		
		IOTLongFormula(IOTFormula<?> aFormula){
			super(aFormula);
		}

		@Override
		protected Long resolveValue(String aValue) {
			if (aValue != null){
				try{
					return Long.valueOf(aValue);
				}catch (Exception e){
				}
			}
			
			return null;
		}
	}
	
	public static class IOTStringFormula extends IOTFormula<String>{
		IOTStringFormula(String aFormula) {
			super(aFormula);
		}
		
		IOTStringFormula(IOTFormula<?> aFormula){
			super(aFormula);
		}

		@Override
		protected String resolveValue(String aValue) {
			if (aValue != null){
				return new String(aValue);
			}else{
				return null;
			}
		}
	}

}
